1. Field of the Invention
Embodiments of the present invention generally relate to a method and apparatus for performing color space conversions, and more particularly between the red, green and blue (RGB) color space and the luminance color, blue color difference and red color difference (YCbCr) color space.
2. Description of the Related Art
The RGB color space is a digital format widely used in computer graphics and imaging. Red, green and blue are the primary additive colors. Components of these primary colors can be combined to form any desired color. The RGB color space is the most prevalent choice for computer graphics frame buffers (the memory used to hold images for display) because computer monitors use red, green and blue phosphors to create the desired color. Consequently, using the RGB color space simplifies the architecture and design of the system.
However, certain operations on the pixel data are better performed in another color space, such as the YCbCr color space. Accordingly, a color space conversion may need to be performed to convert the pixel data from the RGB color space to another color space, such as the YCbCr color space.
ITU-R BT.601 establishes the following formulas for converting from the RGB color space to the YCbCr color space:Y=0.299R+0.587G+0.114B  (1)Cb=0.564(B−Y)  (2)Cr=0.713(R−Y)  (3)
Color space conversion is often implemented by employing multipliers or look-up tables to achieve the multiplication operations, and by combining the resultant component products to complete the conversion. The multiplication operations dominate the operating efficiency and the hardware complexity of a color space converting apparatus. Therefore, the number of multiplication operations is crucial. A 3-by-3 multiplication is typically used for converting between any two color spaces of three color components. Although such a multiplication offers flexibility, it is relatively expensive to implement.
To perform the RGB to YCbCr color space conversion of equations (1) to (3), a conventional color space converter needs to first perform three multiplication operations to obtain the Y color signal, and then derive the (B−Y) and (R−Y) color difference signals before performing two more multiplication operations to obtain the Cb and Cr color signals, respectively. Although the color space converter requires only five multiplication operations that involve relatively simple hardware, the operating efficiency of the color space converter is relatively poor since the multiplication operations are done in two operating stages.
Equations (2) and (3) can be expanded so that the Cb and Cr color signals are entirely in terms of the R, G and B color signals:Cb=−0.169R−0.331G+0.5B  (4)Cr=0.5R−0.419G−0.081B  (5)As such, implementation of equations (1), (4) and (5) requires nine multiplication operations, which makes the color space conversion still a relatively expensive computational process.
Therefore, a need exists in the art for a more cost effective method for performing color space conversion between the RGB color space and the YCbCr color space.